package com.xbai.config;

import com.xbai.bean.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

/**
 * @author jxbai
 * @desc
 * @date 2021/4/25
 */
//使用@PropertySource读取外部配置文件中的k/v保存到运行的环境变量中;加载完外部文件以后使用${}取出配置文件中的值
@Configuration
@PropertySource(value = {"classpath:/person.properties"})
public class MainConfigOfPropertyValue {

    @Bean
    Person person() {
        return new Person();
    }
}
